<div class="bg-light lter b-b wrapper-md">
    <h4 class="m-n font-thin">核销订单</h4>
</div>
<div class="wrapper" ng-controller="checkCtrl">
    <div class="panel-body panel pos-rlt">
        <div>
            <div class="padder-md padder-v bg-light m-b-sm">
                <span class="font-bold">到店商品核销</span>
            </div>
            <div class="m-xs m-b-sm">
                <form name="checkForm">
                    <label class="font-bold control-label block m-b-sm">请输入乐鸽卷密码</label>
                    <div class="input-group m-b-sm w-xxl">
                        <input type="text" class="form-control" name="auth" placeholder="请输入乐鸽卷密码" ng-model="auth" maxlength="20" ng-pattern="/^([1-9][\d]*|0)(\.[\d]{1,2})?$/">
                        <span class="input-group-addon btn btn-success" ng-click="authCheckOrders()">验证并消费</span>
                    </div>
                    <div ng-if="checkForm.auth.$touched">
                        <p ng-if="checkForm.auth.$error.pattern" class="text-danger h6">请输入数字</p>
                    </div>
                </form>
            </div>
        </div>
        <div>
            <div class="padder-md padder-v bg-light m-b-sm">
                <span class="font-bold">对应核销到店商品</span>
            </div>
            <div>
                <table class="table m-b-none table-striped table-responsive">
                    <thead>
                    <tr>
                        <th>
                            乐鸽卷密码
                        </th>
                        <th>
                            店铺订单编号
                        </th>
                        <th>
                            订单编号
                        </th>
                        <th>
                            商品信息
                        </th>
                        <th>
                            实付款
                        </th>
                        <th>
                            支付方式
                        </th>
                        <th>
                            创建时间
                        </th>
                        <th>
                            有效时间
                        </th>
                        <th>
                            使用时间
                        </th>
                        <th>
                            状态
                        </th>
                    </tr>
                    </thead>
                    <tbody ng-if="checkOrders!=null">
                        <tr>
                            <td>
                                {{checkOrders.validationCode}}
                            </td>
                            <td>
                                {{checkOrders.shopOrderNumber}}
                            </td>
                            <td>
                                {{checkOrders.orderNumber}}
                            </td>
                            <td>
                                <div>
                                    <div class="pull-left m-r">
                                        <img src="{{app.image.goods}}{{checkOrders.coverImage}}" err-src="img/error.png" style="width: 60px;height: 60px;">
                                    </div>
                                    <div class="pull-left">
                                        <a href="" class="w-sm h6 l-h block m-b-xs">{{checkOrders.goodsName}}</a>
                                        <label class="font-bold h5 block">¥ {{checkOrders.price}}</label>
                                    </div>
                                </div>
                            </td>
                            <td>
                                <span class="font-bold h5">¥ {{checkOrders.payMoney}}</span>
                            </td>
                            <td>
                                <span  class="h6" ng-bind="{0:'微信'}[checkOrders.payWay]"></span>
                            </td>
                            <td class="h6">
                                {{checkOrders.createdTime}}
                            </td>
                            <td class="h6">
                                {{checkOrders.activeDate}}
                            </td>
                            <td class="h6">
                                {{checkOrders.useTime==null?'--':checkOrders.useTime}}
                            </td>
                            <td>
                                <span ng-bind="{4:'待使用',5:'已使用'}[checkOrders.status]"></span>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <div ng-if="checkOrders==null && !app.loading" class="padder-v text-center">
                    <span class="h6">~未搜索到任何数据~</span>
                </div>
                <div>
                    <circle-loading ng-if="app.loading"></circle-loading>
                </div>
            </div>
        </div>
        <div class="check-box" ng-if="checkStatus==1">
            <i class="block fa fa-times fa-3x text-white m-b-sm"></i>
            <span class="text-white block h5 m-b-sm">验证码无效</span>
            <span class="text-white block h5">未找到相应的线下订单</span>
        </div>
        <div class="check-box" ng-if="checkStatus==2">
            <i class="block fa fa-times fa-3x text-white m-b-sm"></i>
            <span class="text-white block h5 m-b-sm">消费失败</span>
            <span class="text-white block h5">您的验证码已经被使用过了</span>
        </div>
        <div class="check-box-success" ng-if="checkStatus==3">
            <i class="block fa fa-check fa-3x text-success m-b-sm"></i>
            <span class="text-success block h5 m-b-sm">消费成功</span>
            <span class="text-success block h5">很感谢您的使用!</span>
        </div>
    </div>
</div>
